function AlertBox(){
	this.body=document.createElement("div");
	this.body.className="alert_box";
	this.timer=0;
	this.body.innerHTML="<span class='atext'></span>";
	this.styles=".alert_box{display:none;z-index:1060;position:fixed;width:100%;height:2.5em;line-height:2.5em;font-size:1.1rem;left:0;top:0;bottom:0;margin:auto;text-align:center;}.alert_box .atext{display:inline-block;vertical-align:top;border-radius:5px;padding:0 1em;background:rgba(0,0,0,0.6);color:white;}";
	var style=document.createElement("style");
	style.innerHTML=this.styles;
	document.querySelector("head").appendChild(style);
	document.body.appendChild(this.body);
}
AlertBox.prototype.show=function(text,time){
	var time=time||1500;
	var body=this.body;
	body.style.display="block";
	body.style.opacity="1";
	body.children[0].innerHTML=text;
	clearTimeout(this.timer);
	this.timer=setTimeout(function(){
		$(body).stop().animate({opacity:"0"},200,function(){
			$(this).hide();
		});
	},time);
};
var abox=new AlertBox();
